#include "ucos.h"


void OSStartHighRdy() {
    void**tmp;

    /* leave critical section right after context switch */
    set_execution_level(1000); /* X32 RET instruction (used to context switch) restores this */
    ENABLE_INTERRUPT(INTERRUPT_GLOBAL); /* so this only has effect from then on */

    context_switch((void**)OSTCBHighRdy->state[0], &tmp); /* X32 library context switch */
}

void OSCtxSw() {
    OS_TCB *prev;

    prev = OSTCBCur;
    OSTCBCur = OSTCBHighRdy;

    /* leave critical section right after context switch */
    set_execution_level(1000); /* X32 RET instruction (used to context switch) restores this */
    ENABLE_INTERRUPT(INTERRUPT_GLOBAL); /* so this only has effect from then on */

    context_switch((void**)(OSTCBCur->state[0]), (void***)&(prev->state[0])); /* X32 library context switch */
}

void OSIntCtxSw() { }
void OSTickISR() { }
